package com.javaclimb.filmbuy.dao;

import com.javaclimb.filmbuy.entity.CommentInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 评价dao层
 */
@Repository
public interface CommentInfoDao extends Mapper<CommentInfo> {

    /*根据内容和用户等级查评价列表*/
    List<CommentInfo> findByContent(@Param("content")String content, @Param("level")Integer level);

    /*查询某个电影的所有评价*/
    List<CommentInfo> findByGoodsId(@Param("goodsId")Long goodsId);

    /*查询某个电影某个用户的所有评价*/
    List<CommentInfo> findByGoodsIdAndUserId(@Param("goodsId")Long goodsId, @Param("userId")Long userId, @Param("level")Integer level);
}

